package com.tutu.feign.feignclient;

import com.tutu.commons.entity.User;
import org.springframework.stereotype.Component;

/**
 * @Program: SpringCloud
 * @Description: hystrix配合openFeign实现服务降级
 * @Author: JK.TuTu
 * @ @Version: 1.0
 * @Create: 2022-12-02 13:32
 **/
@Component
public class UserClientFallback implements UserClient {
  /*
     * 重写UserClient的方法 做为服务降级时的备选方法
     * @param uid
     * @return*/

    @Override
    public User findUserById(int uid) {
        User user = new User();
        user.setUid(-1);
        user.setName("服务降级");
        user.setSex("xxx");
        return user;
    }
}
